package hl.alde;

import java.util.ArrayList;
import java.util.List;

public class Sort2 {
    public static void mergeSort(int[] a, int low, int high) { //调用mergeSort方法时low为0, high为a.length-1
        int mid = (low + high) / 2;
        if (low < high) {
            mergeSort(a, low, mid);
            mergeSort(a, mid + 1, high);
            merge(a, low, mid, high);
        }
    }

    public static void merge(int[] a, int low, int mid, int high) {
        int[] temp = new int[high - low + 1];
        int i = low;
        int j = mid + 1;
        int k = 0;
        while (i <= mid && j <= high) {
            if (a[i] < a[j])
                temp[k++] = a[i++];
            else
                temp[k++] = a[j++];
        }
        while (i <= mid)
            temp[k++] = a[i++];
        while (j <= high)
            temp[k++] = a[j++];
        for (int index = 0; index < temp.length; index++)
            a[index + low] = temp[index];
    }

    public static void main(String[] args) {
        /*
        int[] a={0,2,1,3,6};
        for (int k:a) {
            System.out.print(" " + k);
        }
        System.out.println();
        mergeSort(a, 0, 4);
        for (int k:a) {
            System.out.print(" " + k);
        }

        List<String> person=new ArrayList<>();
        person.add("jackie");   //索引为0  //.add(e)
        person.add("peter");    //索引为1
        person.add("annie");    //索引为2
        person.add("martin");   //索引为3
        person.add("marry");    //索引为4

        person.remove(3);   //.remove(index)
        person.remove("marry");     //.remove(Object o)

        String per="";
        per=person.get(1);
        System.out.println(per);    ////.get(index)

        for (int i = 0; i < person.size(); i++) {
            System.out.println(person.get(i));  //.get(index)
        }
 */
        //int j = 2;
        Integer j = new Integer(2);
        System.out.println(j);
    }

}
